/**
 * 1. 提供授权窗口
 */

const express = require('express');
const { promisify } = require('util');
const request = promisify(require('request'));

const app = express();
app.get('/callback', async (req, res) => {
  const code = req.query.code;
  const resp = await request(`http://localhost:3000/token?code=${code}`);
  // const body
  // 获取到 token 在获取 userInfo
});

console.log('server is running:3001...');
app.listen(3001);
